<html>
<head>
<title>Configure RS Tools</title>
<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script src="config.js"></script>
<script type="text/javascript">
function get_checkbox_value(name) {
	var val = get(name);
	if(val == "false")
		return false;
	else
		return true;
}

function init_checkbox(name) {
	var box = $('input[name='+name+']');
	box.attr('checked',get_checkbox_value(name));
	box.change(function(e) {
		var val = box.attr('checked');
		put(name,val);
	});
}

function restore_defaults() {
	restore();
	$(':checkbox').each(function(idx,box) { init_checkbox(box.name); });
}

$(document).ready(function() {
	$(':checkbox').each(function(idx,box) { init_checkbox(box.name); });
	$('#main').show();
});

</script>
</head>

<body>
<div id="main" style="display:none;">

<h1>Configure RS Tools</h1>

<h2>Game page modifications</h2>
<table>
	<tr>
		<td><input type="checkbox" name="title-bar" /></td>
		<td>Disable title bar</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="ad-bar" /></td>
		<td>Disable ad bar</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="leave-warning" /></td>
		<td>Warn when leaving the game page</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="focus" /></td>
		<td>Focus on the applet at the start</td>
	</tr>
</table>

<h2>Other actions</h2>
<ul>
	<li><a href="#" onClick="restore_defaults();">Restore defaults</a></li>
</ul>

</div>
</body>
</html>
